package com.xci.sys.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelIgnore;
import com.xci.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * 系统角色
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(description = "系统角色")
public class SysRole extends BaseEntity {
    /**
     * 角色主键
     */
    @ExcelIgnore @Excel(name = "角色主键")
    @ApiModelProperty(value = "角色主键", position = 1)
    private String id;

    /**
     * 角色名称
     */
    @NotBlank(message = "角色名称不能为空")
    @Length(max = 100, message = "角色名称不能超过{max}个字符")
    @Excel(name = "角色名称", width = 30d)
    @ApiModelProperty(value = "角色名称", required = true, position = 2)
    private String name;

    /**
     * 名称简拼
     */
    @Length(max = 100, message = "名称简拼不能超过{max}个字符")
    @ExcelIgnore@Excel(name = "简拼")
    @ApiModelProperty(value = "名称简拼", position = 4)
    private String spell;

    /**
     * 角色编码
     */
    @NotBlank(message = "角色编码不能为空")
    @Length(max = 100, message = "角色编码不能超过{max}个字符")
    @Excel(name = "角色编码", width = 30d)
    @ApiModelProperty(value = "角色编码", required = true, position = 3)
    private String code;

    /**
     * 机构主键
     */
    @NotBlank(message = "请指定机构主键")
    @ExcelIgnore @Excel(name = "机构主键")
    @ApiModelProperty(value = "机构主键", required = true, position = 4)
    private String deptId;

    /**
     * 机构名称
     */
    @Excel(name = "机构名称")
    @ApiModelProperty(value = "机构名称", required = true, position = 5)
    private String deptName;

    /**
     * 数据范围 [全部_1,所在机构_2,所在机构及所有下级_3,自定义_4,仅本人_5]
     */
    // @NotNull(message = "数据范围不能为空")
    @ExcelIgnore @Excel(name = "数据范围")
    @ApiModelProperty(value = "数据范围 [全部_1,所在机构_2,所在机构及所有下级_3,自定义_4,仅本人_5]", required = true, position = 6)
    private Integer deptScope;

    /**
     * 序号
     */
    @NotNull(message = "序号不能为空")
    @Excel(name = "序号")
    @ApiModelProperty(value = "序号", position = 7)
    private Integer path;

    /**
     * 启用状态 [启用_1,禁用_0]
     */
    @NotNull(message = "状态不能为空")
    @Excel(name = "状态", replace = {"启用_true", "禁用_false"})
    @ApiModelProperty(value = "启用状态 [启用_1,禁用_0]", required = true, position = 9)
    private Boolean status;

    /**
     * 备注
     */
    @Length(max = 500, message = "备注不能超过{max}个字符")
    @Excel(name = "备注", width = 40d)
    @ApiModelProperty(value = "备注", position = 100)
    private String remark;
}